home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / library / mfssrgrp.lha / usergroup / resource.c < prev    next >
C/C++ Source or Header  |  1992-09-02  |  2KB  |  66 lines

  1. RCS_ID_C="$Id: resource.c,v 2.1 1994/02/17 12:09:16 ppessi Exp $";
  2. /*
  3.  * resource.c -- handle credential resource
  4.  *
  5.  * Author: ppessi <Pekka.Pessi@hut.fi>
  6.  *
  7.  * This file is part of the AmiTCP/IP usergroup.library.
  8.  *
  9.  * Copyright © 1993 AmiTCP/IP Group, <AmiTCP-Group@hut.fi>
  10.  *                  Helsinki University of Technology, Finland.
  11.  *
  12.  * Created      : Tue Jan 18 10:53:56 1994 ppessi
  13.  * Last modified: Thu Feb 17 07:31:07 1994 ppessi
  14.  *
  15.  */
  16.  
  17. #include "base.h"
  18. #include <exec/memory.h>
  19.  
  20. #include "credential.h"
  21. #include "credential_rev.h"
  22.  
  23. /*
  24.  * Create credential resource
  25.  *
  26.  * Note - this is mindless single-user-version
  27.  */
  28. struct CredentialResource *CredentialInit(const char *name)
  29. {
  30.   struct CredentialResource *res;
  31.   ULONG ressize = sizeof(*res) + sizeof(VSTRING);
  32.  
  33.   res = AllocVec(ressize, MEMF_CLEAR|MEMF_PUBLIC);
  34.  
  35.   CopyMem(CREDENTIALNAME, res->r_name, sizeof(CREDENTIALNAME));
  36.   CopyMem(VSTRING, res->r_vstring, sizeof(VSTRING));
  37.  
  38.   res->r_Lib.lib_Node.ln_Type = NT_RESOURCE;
  39.   res->r_Lib.lib_Node.ln_Name =  (STRPTR)res->r_name;
  40.   res->r_Lib.lib_Flags = LIBF_SUMUSED | LIBF_CHANGED;
  41.   /* res->r_Lib.lib_NegSize = 0; */
  42.   res->r_Lib.lib_PosSize = ressize;
  43.   res->r_Lib.lib_Version = VERSION;
  44.   res->r_Lib.lib_Revision = REVISION;
  45.   res->r_Lib.lib_IdString = (APTR)res->r_vstring;
  46.   /* res->r_Lib.lib_Sum = 0; */
  47.   res->r_Lib.lib_OpenCnt = 1;
  48.  
  49.   res->r_proc->p_ucred = res->r_ucred;
  50.   res->r_proc->p_cred->p_ngroups = 1;
  51.  
  52.   AddResource(res);
  53.  
  54.   return res;
  55. }
  56.  
  57. struct proc *procfind(pid_t pid)
  58. {
  59.   return CredentialBase->r_proc;
  60. }
  61.  
  62. struct ucred *crcopy(struct ucred *cred)
  63. {
  64.   return cred;
  65. }
  66.